Fix #789: Remove cycle between c.b.cyruntime and c.b._lib.cyruntime.cyruntime#914
Fix #789: Remove cycle between c.b.cyruntime and c.b._lib.cyruntime.cyruntime#914leofang merged 9 commits intoNVIDIA:mainfrom
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
|
/ok to test |
This comment has been minimized.
This comment has been minimized.
leofang
left a comment
There was a problem hiding this comment.
LGTM overall! Left a few questions. Is this still WIP (since it's in the draft state)?
|
Auto-sync is disabled for ready for review pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
No, it's ready for review. I didn't notice I created a draft... |
|
/ok to test |
I poked around the generated It looks like when you cimport something it adds a declaration, i.e. for
static cudaError_t (*__pyx_f_4cuda_8bindings_4_lib_9cyruntime_5utils_getDriverEglFrame)(__pyx_t_4cuda_8bindings_8cydriver_CUeglFrame *, __pyx_t_4cuda_8bindings_9cyruntime_cudaEglFrame); /*proto*/
if (__Pyx_ImportFunction_3_0_12(__pyx_t_1, "getDriverEglFrame", (void (**)(void))&__pyx_f_4cuda_8bindings_4_lib_9cyruntime_5utils_getDriverEglFrame, "cudaError_t (__pyx_t_4cuda_8bindings_8cydriver_CUeglFrame *, __pyx_t_4cuda_8bindings_9cyruntime_cudaEglFrame)") < 0) __PYX_ERR(0, 1, __pyx_L1_error)So there's zero linkage happening and everything is declared as static. The symbol resolution is happening via the I think this effectively means we can treat Cython the same way we treat Python where we only need to worry about API compatibility, except for externed vs non-externed declarations in |
|
/ok to test |
|
/ok to test |
|
/ok to test |
|
/ok to test |
|
Thanks a lot @mdboom! |
|
This now textually includes
cuda.bindings._lib.cyruntime.cyruntimeincuda.bindings._bindings.cyruntimeto remove the cycle.Since this is only /adding/ symbols to
cuda.bindings._bindings.cyruntime, I believe it isn't breaking ABI compatibility (but I admittedly am only now getting used to "Cython ABI compatibility"). The oldcuda.bindings._lib.cyruntime.cyruntimeandcuda.bindings._lib.cyruntime.utilsare just removed, but since those were private, I think we ok for ABI there, too.I also discovered a bug in the test for cycles that was finding erroneous cycles when
ImportErrors were raised and caught.Description
closes
Checklist